home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Rexx / AutoLogin.term < prev    next >
Text File  |  1994-07-15  |  1KB  |  67 lines

  1. /* AutoLogin by Bob Maple  © 1993  bmaple@burner.com
  2.  
  3.    AutoLogin_CFG:
  4.    --------------
  5.  
  6.      For those familiar with UUCP, this file is like the L.sys file.
  7.  
  8.      This file consists of a system name, followed by send/expect strings
  9.      necessary to log you into the BBS, starting with an expect string.
  10.      
  11.        \u     Send 'UserName' as defined in TERM
  12.        \p     Send 'Password' as defined in TERM
  13.        <NULL> Valid on expect only.. means 'look for nothing'
  14.        ^M     Sends a return.
  15.        
  16.      Example:
  17.      
  18.      unix      ogin: \u^M ssword: \p^M
  19.      Burner    ESC ^M name \u^M password \p^M
  20.      TVLand    <NULL> ^M erminal i alias \u^M ssword \p^M
  21. */
  22.  
  23. IdleOut = 5     /* How long should AutoLogin wait for an expect string  */
  24.                 /* before giving up and sending it anyway?              */
  25.  
  26.  
  27. options results
  28.  
  29. getattr TERM.SESSION.BBSNAME
  30. system = result
  31.  
  32. call open file, ('TERM:AutoLogin_CFG'), "R";stop = 0
  33.  
  34. TIMEOUT SEC IdleOut
  35.  
  36. do until stop = 1
  37.  
  38.  foo = readln(file);if upper(left(foo,length(system))) = upper(system) then do
  39.  
  40.     say "Logging into "system"..";say
  41.     
  42.     stop = 1
  43.     args = words(foo)
  44.   
  45.     do i = 2 to args by 2
  46.    
  47.       expt = word(foo,i)
  48.       sendit = word(foo,i+1)
  49.  
  50.       say "Expect: "left(expt,10)" Send: "sendit
  51.  
  52.       if expt ~= '<NULL>' then do
  53.  
  54.         CLEAR wait
  55.         ADDITEM TO wait NAME expt
  56.         wait
  57.         
  58.       end
  59.       
  60.       SEND sendit
  61.     
  62.     end
  63.   end
  64. end
  65.  
  66. call close file
  67.